package com.xms.web.framework.model;

import java.util.List;

/**
 * <p>
 * BasePaged
 * </p>
 *
 * @author migo
 * @since 2021/8/29
 */
public class BasePaged<T> {
    public void BasePaged() {

    }
    // 查询所有记录
    public boolean getall = false;

    // 结果数
    public long totalitems = 0;

    // 总页数
    public long totalpages = 0;

    // 结果集
    public List<T> items = null;

    // 当前页
    public int page = 1;

    // 每页记录数
    public int pagesize = 10;

    public boolean pagesizebyseted;

    // 排序字段名称
    public String sortby = "createdon";

    public void setSortby(String sortby){
        this.issortbyseted = true;//!sortby.equals(this.sortby);
        this.sortby = sortby;
    }

    public boolean issortbyseted; // = !sortby.equals("createdon")

    public void setSortdirection(int sortdirection) {
        this.issortbyseted = true;//this.sortdirection != sortdirection;
        this.sortdirection = sortdirection;
    }

    // 排序类型
    public int sortdirection = 1;
}
